# demo04_str.py
str01 = "hello world"
print(str01.startswith("hel"))  # True
print(str01.endswith("hel"))  # False
print(str01.isupper())  # False
print(str01.islower())  # True
str02 = "    hello    world     "
print(str02.strip())  # "hello    world"
print(str02.lstrip())  # "hello    world     "
print(str02.rstrip())  # "    hello    world"
str03 = "hello.tar.gz"
result = str03.split(".")  # 切割
print("split result:", result)  # ['hello', 'tar', 'gz']
list01 = ["world", "tar", "gz"]  # world-tar-gz
str04 = "-".join(list01)
print(str04)  # world-tar-gz  # 拼接
